package com.example.config;

import io.swagger.v3.oas.annotations.OpenAPIDefinition;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author Momo
 */
@Configuration
@OpenAPIDefinition
public class SpringSwaggerConfig {

    @Bean
    public OpenAPI customOpenAPI() {
        Contact contact = new Contact().name("Momo");
        License license = new License().name("Apache 2.0").url("http://www.apache.org/licenses/LICENSE-2.0");
        Info info = new Info().title("接口文档").description("企业版").version("1.0").contact(contact).license(license);

        return new OpenAPI().info(info);
    }
}
